import reqCode from '@/config/reqCode'
import xml2js from '@/utils/xml2js'
import commonRequest from '@/request/commonRequest'
import cacheHandler from '@/utils/cacheHandler'
import { config } from '@/config/systemConfig.js'

function hisAddressInfo(request) {
  const code = reqCode.PATIENT_DIC_HISADDRESSINFO
  const terminalId = cacheHandler.getTerminalId()
  const obj = { terminalId, ...request }
  const xml = xml2js.json2xml(obj)
  const requestBody = commonRequest.generateRequest(code, config.SERVICE_REQUEST_VERSION, commonRequest.hisBizContent(xml))
  return requestBody
}

export default {
  hisAddressInfo
}
